import request from "@/utils/request";

// 搜索框列表
export function getSearchVillage(query) {
  return request({
    url: "/uploadMsg/townShipUpload/getSearchVillage",
    method: "get",
    params: query,
  });
}


// 获取当前用户所在的乡镇列表信息
export function getVillageList(query) {
  return request({
    url: "/uploadMsg/townShipUpload/getVillageList",
    method: "get",
    params: query,
  });
}


//获取商品分类列表
export function listShopType(query) {
  return request({
    url: "/uploadMsg/townShipUpload/getGoodsClassify",
    method: "get",
    params: query,
  });
}


//查询乡村数据详情页
export function getVillageDetail(id) {
  return request({
    url: "/uploadMsg/townShipUpload/getVillageDetail",
    method: "get",
    params: { id: id },
  });
}


//查询乡村数据详情页
export function updateVillageDetail(data) {
  return request({
    url: "/uploadMsg/townShipUpload/updateVillageDetail",
    method: "post",
    data: data,
  });
}

//获取镇下所有村
export function getTownAllVillage(id) {
  return request({
    url: "/uploadMsg/townShipUpload/getAllVillage",
    method: "get",
    params: { id: id },
  });
}

//数据导入类型
export const importWay = [{ type: '导入乡村数据', url: '/uploadMsg/townShipUpload/importVillageMsg' },
  { type: '导入饭店数据', url: '/uploadMsg/townShipUpload/importHotelMsg' },
  { type: '导入饭店菜品数据', url: '/uploadMsg/townShipUpload/importDishesMsg' },
  { type: '导入景点数据', url: '/uploadMsg/townShipUpload/importScenicSpotMsg' },
  { type: '导入特产数据', url: '/uploadMsg/townShipUpload/importGoodsMsg' },
  { type: '导入民宿数据', url: '/uploadMsg/townShipUpload/importHostelMsg' },
  { type: '导入民宿房间数据', url: '/uploadMsg/townShipUpload/importHostelRoomMsg' }
]

//数据导入
export function dataImport(url, data) {
  return request({
    url: url,
    method: "post",
    data: data,
  });
}